﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WindowsUserControl.Codes
{
    /// <summary>
    /// Contains the token IDs for the <c>Simple</c> language.
    /// </summary>
    public class SimpleTokenID
    {
        /// <summary>
        /// Returns the string-based key for the specified token ID.
        /// </summary>
        /// <param name="id">The token ID to examine.</param>
        public static string GetTokenKey(int id)
        {
            System.Reflection.FieldInfo[] fields = typeof(SimpleTokenID).GetFields();
            foreach (System.Reflection.FieldInfo field in fields)
            {
                if ((field.IsStatic) && (field.IsLiteral) && (id.Equals(field.GetValue(null))))
                    return field.Name;
            }
            return null;
        }

        /// <summary>
        /// The Invalid token ID.
        /// </summary>
        public const int Invalid = 0;

        /// <summary>
        /// The DocumentEnd token ID.
        /// </summary>
        public const int DocumentEnd = 1;

        /// <summary>
        /// The LanguageTransitionStart token ID.
        /// </summary>
        public const int LanguageTransitionStart = 2;

        /// <summary>
        /// The LanguageTransitionEnd token ID.
        /// </summary>
        public const int LanguageTransitionEnd = 3;

        /// <summary>
        /// The Whitespace token ID.
        /// </summary>
        public const int Whitespace = 4;

        /// <summary>
        /// The LineTerminator token ID.
        /// </summary>
        public const int LineTerminator = 5;

        /// <summary>
        /// The SingleLineComment token ID.
        /// </summary>
        public const int SingleLineComment = 6;

        /// <summary>
        /// The MultiLineComment token ID.
        /// </summary>
        public const int MultiLineComment = 7;

        /// <summary>
        /// The Number token ID.
        /// </summary>
        public const int Number = 8;

        /// <summary>
        /// The Identifier token ID.
        /// </summary>
        public const int Identifier = 9;

        /// <summary>
        /// The KeywordStart token ID.
        /// </summary>
        public const int KeywordStart = 10;

        /// <summary>
        /// The Function token ID.
        /// </summary>
        public const int Function = 11;

        /// <summary>
        /// The Var token ID.
        /// </summary>
        public const int Var = 12;

        /// <summary>
        /// The Return token ID.
        /// </summary>
        public const int Return = 13;

        /// <summary>
        /// The KeywordEnd token ID.
        /// </summary>
        public const int KeywordEnd = 14;

        /// <summary>
        /// The OperatorOrPunctuatorStart token ID.
        /// </summary>
        public const int OperatorOrPunctuatorStart = 15;

        /// <summary>
        /// The OpenCurlyBrace token ID.
        /// </summary>
        public const int OpenCurlyBrace = 16;

        /// <summary>
        /// The CloseCurlyBrace token ID.
        /// </summary>
        public const int CloseCurlyBrace = 17;

        /// <summary>
        /// The OpenParenthesis token ID.
        /// </summary>
        public const int OpenParenthesis = 18;

        /// <summary>
        /// The CloseParenthesis token ID.
        /// </summary>
        public const int CloseParenthesis = 19;

        /// <summary>
        /// The Comma token ID.
        /// </summary>
        public const int Comma = 20;

        /// <summary>
        /// The SemiColon token ID.
        /// </summary>
        public const int SemiColon = 21;

        /// <summary>
        /// The Addition token ID.
        /// </summary>
        public const int Addition = 22;

        /// <summary>
        /// The Subtraction token ID.
        /// </summary>
        public const int Subtraction = 23;

        /// <summary>
        /// The Multiplication token ID.
        /// </summary>
        public const int Multiplication = 24;

        /// <summary>
        /// The Division token ID.
        /// </summary>
        public const int Division = 25;

        /// <summary>
        /// The Assignment token ID.
        /// </summary>
        public const int Assignment = 26;

        /// <summary>
        /// The Equality token ID.
        /// </summary>
        public const int Equality = 27;

        /// <summary>
        /// The Inequality token ID.
        /// </summary>
        public const int Inequality = 28;

        /// <summary>
        /// The OperatorOrPunctuatorEnd token ID.
        /// </summary>
        public const int OperatorOrPunctuatorEnd = 29;

        /// <summary>
        /// The MaxTokenID token ID.
        /// </summary>
        public const int MaxTokenID = 30;

    }
}
